package com.ruoyi.grade.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.grade.domain.entity.StudentCourseGrade;
import com.ruoyi.grade.domain.entity.StudentCourseGradeother;
import com.ruoyi.grade.domain.entity.StudentTotalGrade;
import com.ruoyi.grade.mapper.StudentCourseGradeMapper;
import com.ruoyi.grade.mapper.StudentTotalGradeMapper;
import com.ruoyi.grade.service.IStudentGradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学生成绩 服务实现
 */
@Service
public class StudentGradeServiceImpl extends ServiceImpl<StudentCourseGradeMapper, StudentCourseGrade>
        implements IStudentGradeService {

    @Autowired
    private StudentCourseGradeMapper studentCourseGradeMapper;

    @Autowired
    private StudentTotalGradeMapper studentTotalGradeMapper;


    /**
     * 查询学生专业课程成绩
     * @param studentId 学生学号
     * @param academicYear 学年
     * @param semester 学期
     * @return 学生课程成绩列表
     */
    @Override
    public List<StudentCourseGrade> selectStudentCourseGradeList(String studentId, String academicYear, String semester) {
        return studentCourseGradeMapper.selectByAcademicYearAndSemester(studentId, academicYear, semester);
    }

    /**
     * 查询学生通识课程成绩
     * @param studentId 学生学号
     * @param academicYear 学年
     * @param semester     学期
     * @return 学生课程成绩列表
     */
    @Override
    public List<StudentCourseGradeother> selectStudentCourseGradeListother(String studentId, String academicYear, String semester) {
        return studentCourseGradeMapper.selectByAcademicYearAndSemesterother(studentId,academicYear, semester);
    }
    /**
     * 查询学生总成绩
     *
     * @param studentId 学生学号
     * @param academicYear 学年
     * @param semester 学期
     * @return 学生总成绩列表
     */
    @Override
    public List<StudentTotalGrade> selectStudentTotalGradeList(String studentId, String academicYear, String semester) {
        return studentTotalGradeMapper.selectByAcademicYearAndSemester(studentId, academicYear, semester);
    }
}
